package com.beaut.project.control;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.beaut.project.service.FinanceService;
import com.beaut.project.service.StatisticService;



/**
 * 统计分析
 * @author jzk
 *
 */
@Controller
@RequestMapping("/statistic")
public class StatisticController extends BaseControl{
	@Autowired
	private StatisticService statisticService;
	private Logger logger = Logger.getLogger(StatisticController.class);

	@RequestMapping(value = "/gdStatistic", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String gdStatistic(HttpServletRequest request) {
		try{	
	 		return statisticService.gdStatistic(requestParameterToMap(request));
		}catch(Exception e){
	   	 logger.error("工单统计失败--------------------",e);
	    }
		return null;
    }
	@RequestMapping(value = "/xmStatistic", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody String xmStatistic(HttpServletRequest request) {
		return statisticService.xmStatistic(requestParameterToMap(request));
	}
	@RequestMapping(value = "/listPageGdLoan", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageGdLoan(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMap(request));
    	return statisticService.listPageGdLoan(map);
    }
	@RequestMapping(value = "/listPageGdStatus", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageGdStatus(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMap(request));
    	return statisticService.listPageGdStatus(map);
    }
	@RequestMapping(value = "/listPageXmStatus", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXmStatus(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMap(request));
    	return statisticService.listPageXmStatus(map);
    }
	@RequestMapping(value = "/listPageGDBase", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageGDBase(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMap(request));
    	return statisticService.listPageGDBase(map);
    }
	@RequestMapping(value = "/listPageXMBase", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMBase(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMap(request));
    	return statisticService.listPageXMBase(map);
    }
	@RequestMapping(value = "/listPageHistory", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody String listPageHistory(HttpServletRequest request) {
		Map<String, Object> map = getPagerMap(request);
		map.putAll(requestParameterToMap(request));
		return statisticService.listPageHistory(map);
	}
	@RequestMapping(value = "/listPageGd", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	public @ResponseBody String listPageGd(HttpServletRequest request) {
		Map<String, Object> map = getPagerMap(request);
		map.putAll(requestParameterToMap(request));
		return statisticService.listPageGd(map);
	}
}
